In the prior art, many message delivery systems exist which route messages between endpoints, such as between different applications. The messages may be routed to destination endpoints based on topics, queues, characteristics of the message content or a combination of criteria such as a topic to queue mapping. In the case of a system that routes messages based on topics an example of which is described in U.S. Pat. No. 7,716,525, the contents of which are herein incorporated by reference, there are publishing (or producing) clients that generate messages and subscribing (or consuming) clients that receive messages. When a publishing client creates a message it adds to it a topic. Destination endpoints are created by subscribing clients that have associated with them a series of subscriptions (or interests) that are used to attract messages to the subscribing application. Alternately subscriptions may be used to attract messages to a queue endpoint which one or more applications can connect to and receive messages. The topics are typically text strings that often contain sub-fields also known as hierarchical levels but, maybe also be numbers. Interests or subscriptions are of a similar form to the topics but, may contain regular expressions (also known as wild cards) or if the topics are in the form of numbers, the interests could be in the form of a range of numbers. If the messages are to be routed based on the message content then the subscriptions are in the form of regular expressions designed to match a portion of the content or an expression in a query language such as SQL or XPATH (if the message content is in XML format). The interests are gathered by the message delivery system and are used to determine which destination endpoint(s) should receive a copy of a particular message received from a publishing application in a process called matching. In the topic based message delivery system the process of matching involves comparing the topics of messages received from publishing clients to the interests gathered from subscribing applications or queues. A match to an interest is generated when the topic of the incoming messages falls within the regular expression(s) contained in the interest. The present invention is also applicable to systems that route messages based on the content of the message as described in U.S. Pat. Nos. 7,627,570 and 7,801,857 the contents of which are herein included by reference.
Applications that make use of message delivery systems are often mission critical and must have some resiliency built in, either a redundant system or the ability to restart from the previous state. A construct that is useful in implementing resilient applications is the last message queue as it is known in the art. The last message queue is simply a queue with an associated topic interest that is configured to hold only the most recent message sent to the topic. This construct works well for subscribing applications that need to know the most recent state of a particular message flow especially in cases where updates to the message flow are infrequent. Upon restarting a subscribing client can simply connect to the last message queue to recover the most recent state rather than waiting for the next message. The last message queue is less useful for publishing applications because multiple publishing clients can publish messages to the same topic endpoints. In order to uniquely identify the messages sent by a particular publishing client, a unique identifier for that client must be included in the topic hierarchy. This causes a number of unwanted side effects; the size of the topic space grows geometrically by the number of publishing clients and it is difficult to retrofit because it changes the structure of the topic (affecting all clients of the message delivery system). It is a useful feature of a message delivery system to have a last message queue that can be associated with a particular publisher without affecting the topic hierarchy.